package com.zhongketech.sunflower.utils;

import java.util.Calendar;
import java.util.TimeZone;

import com.zhongketech.sunflower.transport.LogUtil;

import android.text.format.Time;

public class DataString {
	private static int mYear;
	private static int mMonth;
	private static int mDay;
	private static int mWay;
	private static int mHour;
	private static int mMin;
	private static int minOfDay;

	private static DataString instance = new DataString();

	private DataString()
	{

	}

	public static DataString getInstance()
	{
		final Calendar c = Calendar.getInstance();
		c.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
		instance.setmYear((c.get(Calendar.YEAR))); // 获取当前年份
		instance.setmMonth((c.get(Calendar.MONTH) + 1));// 获取当前月份
		instance.setmDay((c.get(Calendar.DAY_OF_MONTH)));// 获取当前月份的日期号码
		instance.setmWay((c.get(Calendar.DAY_OF_WEEK)));
		instance.setmHour(c.get(Calendar.HOUR_OF_DAY));
		instance.setmMin(c.get(Calendar.MINUTE));

		//		Time time = new Time("GMT+8");    
		//		time.setToNow();  
		//		instance.setmYear(time.year);  
		//		instance.setmMonth(time.month);   
		//		instance.setmDay(time.monthDay); 
		//		instance.setmWay(time.weekDay);
		//		instance.setmHour(time.hour);
		//		instance.setmMin(time.minute);
		//		if("1".equals(mWay)){
		//			mWay ="天";
		//		}else if("2".equals(mWay)){
		//			mWay ="一";
		//		}else if("3".equals(mWay)){
		//			mWay ="二";
		//		}else if("4".equals(mWay)){
		//			mWay ="三";
		//		}else if("5".equals(mWay)){
		//			mWay ="四";
		//		}else if("6".equals(mWay)){
		//			mWay ="五";
		//		}else if("7".equals(mWay)){
		//			mWay ="六";
		//		}

		return instance;
	}

	public  int getmYear() {
		return mYear;
	}

	public  void setmYear(int mYear) {
		DataString.mYear = mYear;
	}

	public  int getmMonth() {
		return mMonth;
	}

	public  void setmMonth(int mMonth) {
		DataString.mMonth = mMonth;
	}

	public  int getmDay() {
		return mDay;
	}

	public  void setmDay(int mDay) {
		DataString.mDay = mDay;
	}

	public  int getmWay() {
		return mWay;
	}

	public  void setmWay(int mWay) {
		if(1 == mWay)
		{
			DataString.mWay = 7;
		}
		else
		{
			DataString.mWay = mWay - 1;			
		}

	}

	public  int getmHour() {
		return mHour;
	}

	public  void setmHour(int mHour) {
		DataString.mHour = mHour;
	}

	public  int getmMin() {
		return mMin;
	}

	public  void setmMin(int mMin) {
		DataString.mMin = mMin;
	}

	public  int getMinOfDay() {

//		LogUtil.i("ZK", "hour:"+mHour+" min:"+mMin);
		minOfDay = mHour * 60 + mMin;
		return minOfDay;
	}

}

